<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ include file="/common/base.jsp"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html>
<html lang="zh-cn">
<head>
<base href="<%=basePath%>">

<title>农民档案信息列表</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport"
	content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<meta name="renderer" content="webkit">

<link rel="stylesheet" href="css/styles.css">
<link rel="stylesheet" href="css/admin.css">
<script src="js/jquery-1.4.4.min.js"></script>
<script src="js/admin.js"></script>
</head>

<body>
	<form name="searchForm" id="searchForm"
		action="<%=request.getContextPath()%>/system/MemberServlet?m=select"
		method="post">
		<div class="panel admin-panel">
			<div class="panel-head">
				<strong class="icon-reorder">农民档案信息列表</strong>
			</div>
			<div class="padding border-bottom">
				<ul class="search" style="padding-left:10px;">
					<li>搜索:</li>
					<li><input type="text" name="title" id="title" value=''
						placeholder="请输入搜索户主姓名" class="input"
						style="width:250px; line-height:17px;display:inline-block" />
						<button type="submit" class="button border-main icon-search"
							onclick="javascript:window.location.href='<%=request.getContextPath()%>/system/MemberServlet'">搜索</button>
					<li></li>
				</ul>
			</div>
		</div>
	</form>
	<%	
		String housemaster = request.getParameter("title");
		
		if (housemaster == null ) {
				StringBuffer sb = new StringBuffer(1024);
				sb.append("1=1");
				List<House> newsList = House.getNewsList(sb.toString());
				request.setAttribute("newsList", newsList);
			}
			
 	%>
	<table class="table table-hover text-center">
		<thead>
			<tr>
				<th>家庭编号</th>
				<th>户内编号</th>
				<th>姓名</th>
				<th>性别</th>
				<th>民族</th>
				<th>户属性</th>
				<th>身份证号</th>
				<th>操作</th>
			</tr>
		</thead>

		<tbody>
			<c:forEach var="news" items="${newsList}" varStatus="status">
				<tr>
					<td>${news.familycode}</td> 
					<td>${news.housecode}</td>
					<td>${news.housemaster}</td> 
					<td>${news.sex }</td>
					<td>${news.nation }</td>
					<td>${news.relationship}</td>
					<td>${news.idcard}</td>
					<td><div class="button-group">
							<a class="button border-main" href='<%=path%>/system/MemberServlet?m=input&familycode=${news.familycode}'>新增成员</a>
                            <a class="button border-red" href="javascript:if(confirm('确认是否删除此户主信息？')) location='<%=request.getContextPath() %>/servlet/MemberServlet?m=delhz&familycode=${news.familycode}'">删除户主</a>
                            <a class="button border-main" href='<%=path%>/system/MemberServlet?m=ckcy&familycode=${news.familycode}'>查看成员</a>
                        </td>
                </tr>
			</c:forEach>
		</tbody>

	</table>
</body>

</html>
